package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ContractAccountsMapper;
import com.ruoyi.system.domain.ContractAccounts;
import com.ruoyi.system.service.IContractAccountsService;

/**
 * 账款管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-13
 */
@Service
public class ContractAccountsServiceImpl implements IContractAccountsService 
{
    @Autowired
    private ContractAccountsMapper contractAccountsMapper;

    /**
     * 查询账款管理
     * 
     * @param id 账款管理主键
     * @return 账款管理
     */
    @Override
    public ContractAccounts selectContractAccountsById(Long id)
    {
        return contractAccountsMapper.selectContractAccountsById(id);
    }

    /**
     * 查询账款管理列表
     * 
     * @param contractAccounts 账款管理
     * @return 账款管理
     */
    @Override
    public List<ContractAccounts> selectContractAccountsList(ContractAccounts contractAccounts)
    {
        return contractAccountsMapper.selectContractAccountsList(contractAccounts);
    }

    @Override
    public List<ContractAccounts> selectProjectAccountsList(ContractAccounts contractAccounts)
    {
        return contractAccountsMapper.selectProjectAccountsList(contractAccounts);
    }

    /**
     * 新增账款管理
     * 
     * @param contractAccounts 账款管理
     * @return 结果
     */
    @Override
    public int insertContractAccounts(ContractAccounts contractAccounts)
    {
        contractAccounts.setCreateTime(DateUtils.getNowDate());
        return contractAccountsMapper.insertContractAccounts(contractAccounts);
    }

    /**
     * 修改账款管理
     * 
     * @param contractAccounts 账款管理
     * @return 结果
     */
    @Override
    public int updateContractAccounts(ContractAccounts contractAccounts)
    {
        contractAccounts.setUpdateTime(DateUtils.getNowDate());
        return contractAccountsMapper.updateContractAccounts(contractAccounts);
    }

    /**
     * 批量删除账款管理
     * 
     * @param ids 需要删除的账款管理主键
     * @return 结果
     */
    @Override
    public int deleteContractAccountsByIds(Long[] ids)
    {
        return contractAccountsMapper.deleteContractAccountsByIds(ids);
    }

    /**
     * 删除账款管理信息
     * 
     * @param id 账款管理主键
     * @return 结果
     */
    @Override
    public int deleteContractAccountsById(Long id)
    {
        return contractAccountsMapper.deleteContractAccountsById(id);
    }
}
